<?php
/**
 * Image.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-02-18 16:49:43
 * @modified    2023-02-18 16:49:43
 *
 */

namespace App\Models\WorkOrder\Receipt;

use App\Models\BaseModel;
use App\Services\ImageServ;

class Image extends BaseModel
{
    protected $table = 'work_order_receipt_image';
    protected $fillable = [
        'work_order_receipt_id',
        'image'
    ];

    protected $appends = ['image_url'];

    public function getImageUrlAttribute()
    {
        $img = $this->image;
        $url = (new ImageServ($img))->getUrl();
        return $url;
    }
}